package com.mylib.libcore.tools;

import android.content.Context;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.mylib.libcore.R;
import com.mylib.libcore.utils.UIUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * @date 2020/3/2-20:48
 * @description
 **/
public class CustomLayoutAddViewUtil {
    private Context mContext;
    private List<View> viewList = new ArrayList<>();

    //事件回调
    private ItemViewClink itemViewClink;

    public interface ItemViewClink{
        void onItemClink(int index, String type, View layout_view);
    }

    public void SetOnItemViewClink(ItemViewClink itemViewClink){
        this.itemViewClink = itemViewClink;
    }
    public CustomLayoutAddViewUtil(Context context) {
        this.mContext = context;
        viewList.clear();
    }

    /**
     * @param index
     * @return
     */
    public View addItemLayout(int index) {

        //实例化一个view
        View  layout_view =  View.inflate(mContext, R.layout.item_dialog_bottom_recycle_view,null);

//        //设置view属性(宽和高)
//        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
//        //设置边距
//        layoutParams.weight =1;
//      //  layoutParams.setMargins(0, 0, 0,0);
//        //将以上的属性赋给view
       // layout_view.setLayoutParams(layoutParams);

        return layout_view;
    }




}
